<div ng-show="(pagedata.params.status >= 4 || pagedata.userdeleted == 1) && (pagedata.params.status!=100 || (pagedata.userdeleted == 1 && pagedata.params.status==100))" class="fui-tab fui-tab-danger jy2-headertop" style="top:2.5rem;margin-top:0">
			<a href="javascript:" ng-click="pagedata.userdeleted = 0;pagedata.params.status = 100;tool.get_list('jy_weishop/order.list/getlist/',true)" class="external">其他订单</a>
			<a ng-class="{'external active':pagedata.params.status == 5}" ng-click="pagedata.params.status = 5;tool.get_list('jy_weishop/order.list/getlist/',true)">申请售后</a>
			<a ng-class="{'external active':pagedata.params.status == 6}" ng-click="pagedata.params.status = 6;tool.get_list('jy_weishop/order.list/getlist/',true)">处理售后</a>
			<a ng-class="{'external active':pagedata.params.status == 4}" ng-click="pagedata.params.status=4;tool.get_list('jy_weishop/order.list/getlist/',true)">已关闭</a>
			<a ng-class="{'external active':pagedata.userdeleted == 1 && pagedata.params.status==100}" ng-click="pagedata.params.status=100;pagedata.userdeleted=1;tool.get_list('jy_weishop/order.list/getlist/userdeleted=1',true)">已删除</a>
	</div>
	<div ng-show="(pagedata.params.status < 4 || pagedata.params.status==100) && pagedata.userdeleted!=1" class="fui-tab fui-tab-danger jy2-headertop" style="top:2.5rem;margin-top:0">
			 <a ng-class="{'external active':pagedata.params.status == 100 && pagedata.userdeleted!=1}" ng-click="pagedata.params.status = 100;tool.get_list('jy_weishop/order.list/getlist/',true)">全部</a>
			<a ng-class="{'external active':pagedata.params.status == 0}" ng-click="pagedata.params.status = 0;tool.get_list('jy_weishop/order.list/getlist/',true)">待付款</a>
			<a ng-class="{'external active':pagedata.params.status == 1}" ng-click="pagedata.params.status = 1;tool.get_list('jy_weishop/order.list/getlist/',true)">已付款</a>
			<a ng-class="{'external active':pagedata.params.status == 2}" ng-click="pagedata.params.status = 2;tool.get_list('jy_weishop/order.list/getlist/',true)">待收货</a>
			<a ng-class="{'external active':pagedata.params.status == 3}" ng-click="pagedata.params.status = 3;tool.get_list('jy_weishop/order.list/getlist/',true)">已完成</a>
	 
	</div>
<div class='fui-content order-list' style="margin-top:0.7rem">
		<div class="fui-list-group order-item" ng-repeat="item in pagedata.list">
                <a class="fui-list external" style="padding: 0.42rem 0.5rem" data-nocache="true" ng-click="access_json('/order.detail//id='+item.id)">
                    <div class="fui-list-inner">
                        <div class="subtitle"> 订单号: {{item.ordersn}}</div>
                    </div>
                    <div class="row-remark text-cancel" style="width: auto; font-size: 0.65rem;text-align: right;">{{item.statustitle}}</div>
                    <div class="angle"></div>
                </a> 
					<div ng-repeat="m in item.merchs">
						<a ng-if="m.id" href="javascript:;" data-nocache="true" ng-click="access_json('jy_merch/merch//id='+m.id)">
							<div class="fui-list-group-title lineblock bold">
								<i class="icon jinyunicon icon-dianpu"></i> {{m.merchname || '多商户'}}
								<span class="status noremark" style="font-size:0.50rem" ><i class="icon jinyunicon icon-icon-test"></i></span>
							</div>
						</a>
						<a ng-if="!m.id">
							<div class="fui-list-group-title lineblock bold">
								<i class="icon jinyunicon icon-dianpu"></i> {{pagedata.shopset.store_title || '平台自营'}}
								<span class="status noremark" style="font-size:0.50rem" ><i class="icon jinyunicon icon-icon-test"></i></span>
							</div>
						</a>
						<a href="javascript:;" ng-repeat="g in m.goods" class="external" data-nocache="true" ng-click="access_json('/order.detail//id='+item.id)">
							<div class="fui-list goods-list">
								<div class="fui-list-media" style="">
									<img class="" ng-src="{{tomedia(g.image) || '../core/resource/images/nopic.jpg'}}">
								</div>
								<div class="fui-list-inner">
									<div class="text goodstitle towline">{{g.title}}</div>
									<div class="text" style="color:#f60;font-size:0.60rem">{{g.selespename || '无规格'}} x {{g.total || 1}} /{{g.unit ||'件'}}<span ng-if="g.weight!='0.00'"> ({{g.weight}}g)</span></div>
									<div class="text"><i class="fui-tag fui-tag-red">{{item.buytypetitle}}</i></div>
									
								</div>
								<div class="fui-list-angle" style="width:auto">
									<div><span class="marketprice syscolorred">￥{{g.price}}</span></div>
									<div class="subtitle" ng-if="pagedata.feemoney.isopen==1">{{pagedata.feemoney.tag ||'节省'}}￥{{g.feemoney || '0.00'}}</div>
									<div ng-show="g.can_refund==1" class="btn btn-sm btn-default-o order-finish" style="line-height:1.8;" href="javascript:;" ng-click="access_json('jy_weishop/order.refund/apply/orderid='+item.id+'&ordergoodsid='+g.ordergoodsid)">申请退款</div>
									<div ng-show="g.can_refund==2" class="btn btn-sm btn-default-o order-finish" style="line-height:1.8;" href="javascript:;" ng-click="access_json('jy_weishop/order.refund/apply/orderid='+item.id+'&ordergoodsid='+g.ordergoodsid)">申请售后</div>
									<div ng-show="g.refund_id>0" class="btn btn-sm btn-default-o order-finish" style="line-height:1.8;" href="javascript:;" ng-click="access_json('jy_weishop/order.refund/list/orderid='+item.id)">查看退款</div>
								</div>
							</div>
						</a>
					</div>
                <div class="fui-list-group-title lineblock">
					<span style="color:#999;font-size:0.65rem"><i class="icon jinyunicon icon-shijian" style="color:#f60;font-size:0.60rem"></i> {{item.createtime}} 共{{item.total}}个商品</span>
                    <span class="status noremark"> <span style="color:#999;font-size:0.65rem" ng-if="item.yuejiemid>0">月结支付</span><span style="color:#999;font-size:0.65rem" ng-if="item.yuejiemid==0">{{item.paytypetitle||'现金需付'}}</span> <span class="text-danger">{{item.creditfee>0?item.creditfee+'个':'￥'+item.price}}</span></span>
                </div>
				<div ng-if="item.addprice!='0.00'" class="title" style="padding:0 0.5rem">
				<div ng-if="item.addprice!='0.00'"><i class="icon icon-trade" style="font-size: 0.65rem"> 多退少补：<span class="price red">￥{{item.addprice || '0.00'}}</span><span class="gray" ng-if="item.addprice<0">(确认收货后退差价)</span></i> <div ng-if="item.addprice>0 && item.ispayadd!=1" class="btn btn-sm btn-success-o order-finish" style="border-radius: 1rem;padding:0 0.5rem" href="javascript:" ng-click="pagedata.payaddprice(item.id);">补差价</div></div>
				</div>
				<div ng-if="pagedata.feemoney.isopen==1" class="fui-list" style="padding-top:0">
						<div class="fui-list-info noremark" style="font-size:0.6rem">
							<span class="syscolorred">本单共节省 ￥{{item.feemoney}} <span class="subtitle" style="font-size:0.6rem">（同比市场价节省，不含优惠折扣）</span></span>
						</div>
				</div>
            <div class="fui-list-group-title lineblock opblock">
				<span class="status noremark">
					<div ng-show="item.can_cancel" class="btn btn-sm btn-default-o order-delete" href="javascript:;" ng-click="pagedata.checkcancel=true;pagedata.orderid=item.id">取消订单</div>
					<div ng-show="item.status == 0 && item.paytype!='peerpay'" class="btn btn-sm btn-danger-o order-finish" ng-click="pay_submit({},'//pay/id='+item.id,'/order.list/','/order.list/')">支付订单</div>
					<div ng-show="item.status == 0 && item.paytype=='peerpay'" class="btn btn-sm btn-danger-o order-finish" ng-click="access_json('jy_weishop/order.peerpay/share/orderid='+item.id)">找人代付</div>
					<div ng-show="item.status == 3 && item.pingjia != 3 && item.pingjia != 2" class="btn btn-sm btn-danger-o order-finish" ng-click="access_json('jy_weishop/order.comment/commentorder/id='+item.id)">{{item.pingjia==1?'修改评价':'去评价'}}</div>
					<div ng-show="item.sendtype==1 && item.status == 2" class="btn btn-sm btn-danger-o order-finish" href="javascript:;" ng-click="post({'id':item.id},'receive')">确认收货</div>
					<div ng-show="item.sendtype==2 && item.status==2" class="btn btn-sm btn-danger-o order-finish" href="javascript:;" ng-click="access_json('/order.detail//id='+item.id)">前往使用</div>
					<div ng-show="item.status > 0" class="btn btn-sm btn-danger-o order-finish" href="javascript:;" ng-click="access_json('/order.list/buyto/orderid='+item.id)">再来一单</div>
					<div ng-show="!item.can_cancel && item.can_refund" class="btn btn-sm btn-danger-o order-finish" href="javascript:;" ng-click="access_json('jy_weishop/order.refund/apply/orderid='+item.id)">申请退款</div>
					<div ng-show="item.status==5" class="btn btn-sm btn-default-o order-finish" href="javascript:;" ng-click="access_json('jy_weishop/order.refund/list/orderid='+item.id)">查看退款进度</div>
				</span>
            </div>
        </div>
		<div class="content-empty" ng-show="!pagedata.list || pagedata.list.length == 0 ">
		  <i class="icon jinyunicon icon-cry" style="width: 6rem;margin-bottom: 0.5rem;"></i><br/><p style="color: #999;font-size: .75rem">您暂时没有订单！</p>
		</div>
	</div>
<script>
if(scope.pagedata.redfee>0){
	$("#openvoice")[0].play();
}
scope.pagedata.payaddprice=function(id){
	scope.post_json('jy_weishop/order.list/payaddfee/id='+id,{},function(result){
		scope.pagedata.order_id=result.order_id;
		scope.$evalAsync();
		scope.tool.pay(result.pay_id,function(res){
				if(res.type=='success'){
					scope.message('支付成功！','success','/order.list/');
				}else{
					scope.message('支付失败！','success','/order.list/');
				}
		},'','','/order.list/');
	});
}
if(scope.pagedata.gopayaddpriceid>0){
	scope.pagedata.payaddprice(scope.pagedata.gopayaddpriceid);
}
scope.tool.get_list('jy_weishop/order.list/getlist/',true);
scope.pagedata.scroll_bottom=function(){
	scope.tool.get_list('jy_weishop/order.list/getlist/');
}
</script>